;数据段
datas SEGMENT
    inputer db 'please input a letter: $'
    former db 'the former letter: $'
    owner db 'the letter itself: $'
    latter db 'the latter letter: $'
datas ENDS

;堆栈段
stacks SEGMENT
    db 100 dup(0)
stacks ENDS

crlf MACRO
    mov dl,0ah
    mov ah,2
    int 21h
    mov dl,0dh
    mov ah,2
    int 21h
ENDM

outer MACRO
    mov dl,bl
    mov ah,2
    int 21h
ENDM

;代码段
codes SEGMENT
    assume cs:codes,ds:datas,ss:stacks
start:
    mov ax,datas
    mov ds,ax

    lea dx,inputer
    mov ah,9
    int 21h

    mov ah,1
    int 21h

    mov bl,al   ;防止al内容被写掉，先存入bl中
    crlf
    crlf

    lea dx,former
    mov ah,9
    int 21h

    sub bl,1h
    outer
    crlf

    lea dx,owner
    mov ah,9
    int 21h

    add bl,1h
    outer
    crlf

    lea dx,latter
    mov ah,9
    int 21h

    add bl,1h
    outer

    mov ah,4ch
    int 21h
 codes ENDS
    end start